package jym.tan.tmdb.method.get;

import java.net.URL;

import jym.tan.tmdb.TMDB;
import jym.tan.tmdb.bean.wrapper.MovieKeywordWrapper;
import jym.tan.tmdb.constant.TMDBConstants;
import jym.tan.tmdb.method.Base;

/**
 * The Class MovieKeywords. This class is similar to the <b>Movie Keywords</b> method described in 
 * <a href="http://help.themoviedb.org/kb/api/movie-keywords">Movie Keywords</a>.
 * This method is used to retrieve all of the keywords that have been added to a particular movie. 
 * Currently, only English keywords exist.
 * @author Tanmoy
 */
public class MovieKeywords extends Base {

	/**
	 * Instantiates a new MovieKeywords.
	 *
	 * @param tmdb 
	 * 		An instance of the {@link TMDB} class
	 */
	public MovieKeywords(TMDB tmdb) {
		super(tmdb, TMDBConstants.MOVIE, TMDBConstants.KEYWORDS);
	}
	
	/**
	 * Gets a {@link MovieKeywordWrapper} object.
	 *
	 * @param movieId 
	 * 		The TMDB id / the IMDB id
	 * @return 
	 * 		The <code>MovieKeywordWrapper</code> object
	 * @throws Exception 
	 * 		If any kind off exception occurred
	 */
	public MovieKeywordWrapper getMovieKeywordWrapper(String movieId) throws Exception {
		URL movieKeywordURL = getUrl(movieId);
		MovieKeywordWrapper movieKeywordWrapper = getJsonObject(movieKeywordURL, MovieKeywordWrapper.class);		
		return movieKeywordWrapper;		
	}
}
